/*
 *  ofxSystemSingleton.h
 *  openFrameworks
 *
 *  Created by Arick on 8/17/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */
#pragma once

#include "ofxFMODIncludes.h"

class ofxFMODSystem
{
	public:
		FMOD_SYSTEM *getSystem() {return system;}
		FMOD_RESULT				result;
		unsigned int			version;

	static ofxFMODSystem *getInstance();

	private:
		ofxFMODSystem();

		/**
		 * Note that although this should be allowed,
		 * some compilers may not implement private destructors
		 * This prevents others from deleting our one single instance,
		 * which was otherwise created on the heap
		 */
		~ofxFMODSystem(){}
	private:
		FMOD_SYSTEM *system;
		static ofxFMODSystem* instance;

		// Note that the next two functions are not given bodies, thus any attempt
		// to call them implicitly will return as compiler errors. This prevents
		// accidental copying of the only instance of the class.
		ofxFMODSystem(const ofxFMODSystem &old); // disallow copy constructor
		void ERRCHECK(FMOD_RESULT result);
};
